package com.vpclub;

import com.vpclub.config.MainConfigOfLifeCycle;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author : leimingchao
 * @date Date : 2021年06月22日 21:44
 */
public class IOCTest_LifeCycle {

    @Test
    public void test() {
        //1.创建ioc容器
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(MainConfigOfLifeCycle.class);
        System.out.println("容器创建完成。。。。");
        annotationConfigApplicationContext.getBean("car");
        //容器关闭
        annotationConfigApplicationContext.close();
    }
}
